package demo3;

public class Main {
    public static void main(String[] args) {
        //1、创建抽奖对象，确定数据类型
        ProductGetter<String> stringProductGetter = new ProductGetter<>();
        String[] strProducts = {"手机","电脑","冰箱"};

        //2、在抽奖器中，填充奖品
        for (int i = 0; i < strProducts.length; i++) {
            stringProductGetter.addProduct(strProducts[i]);
        }

        //3、随机抽奖
        String product1 = stringProductGetter.getProduct();
        System.out.println("恭喜你，抽中了："+product1);

        System.out.println("================");
        ProductGetter<Integer> integerProductGetter = new ProductGetter<>();
        int[] intProducts = {5000,3000,1000,500};
        for (int i = 0; i < intProducts.length; i++) {
            integerProductGetter.addProduct(intProducts[i]);
        }
        Integer product2 = integerProductGetter.getProduct();
        System.out.println("恭喜你，抽中了："+product2);

    }
}